<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="../../assets/layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="../../assets/css/admin.css" />		
	</head>
	<body>
		<div style="margin: 30px;">
			<form class="layui-form" action="" method="post" onsubmit="return false;">
				<div class="layui-form-item">
					<label class="layui-form-label"><span style="color: red">*</span>类型code</label>
					<div class="layui-input-block">
						<input type="text" name="configType" id="configType" 
							   autocomplete="off" placeholder="请输入配置类型code" class="layui-input" required>
					</div>
					<input type="hidden" name="configId" id="configId">
					<input type="hidden" name="type" id="type">
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><span style="color: red">*</span>类型name</label>
					<div class="layui-input-block">
						<input type="text" name="configTypeName" id="configTypeName" 
							   autocomplete="off" placeholder="请输入配置类型name" class="layui-input" required>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><span style="color: red">*</span>配置code</label>
					<div class="layui-input-block">
						<input type="text" name="configCode" id="configCode" 
							   autocomplete="off" placeholder="请输入配置code" class="layui-input" required>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><span style="color: red">*</span>配置name</label>
					<div class="layui-input-block">
						<input type="text" name="configName" id="configName" 
							   autocomplete="off" placeholder="请输入配置name" class="layui-input" required>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><span style="color: red">*</span>配置value</label>
					<div class="layui-input-block">
						<input type="text" name="configName" id="configName" 
							   autocomplete="off" placeholder="请输入配置name" class="layui-input" required>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button class="layui-btn" lay-submit="" lay-filter="demo1">提交</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
			</form>
		</div>
		<script type="text/javascript" src="../../js/common/jquery-1.10.2.min.js"></script>
		<script type="text/javascript" src="../../assets/layui/layui.js"></script>
		<script type="text/javascript" src="../../assets/plugins/jquery-validation-1.14.0/dist/jquery.validate.min.js"></script>
		<script type="text/javascript" src="../../assets/plugins/jquery-validation-1.14.0/lib/jquery.form.js"></script>
		<script type="text/javascript" src="../../assets/plugins/jquery-validation-1.14.0/dist/localization/messages_zh.min.js"></script>
		<script type="text/javascript" src="../../js/common/formUtil.js"></script>
		<script type="text/javascript" src="../../js/common/commonUtil.js"></script>
		<script type="text/javascript">
		 	layui.config({
				base: '../../assets/' //静态资源所在路径
			}).extend({
				index: 'lib/index' //主入口模块
			}).use(['index','layer','form'], function() {
				var $ = layui.jquery,
					layer = layui.layer,
				    form = layui.form;
				
				if (!ComUtil.isEmpty($("#configId").val())) {
					ComUtil.AjaxData(".layui-form","", function(obj, data) {
						FromEngine.jsonBindForm(obj, data.data);
					}, {
						ConfigId : $("#configId").val()
					});
				}
				FromEngine.vsFrom(".layui-form", {
					debug : false,
					beforeSubmitFunction:function(){
						$("#type").val("<%=type%>");
						return true;
					},
					cfgUrlOrFunction : path + "/a/setting/ConfigAction/saveConfigInfo.do",
					cfgCallBack : function(result) {
						ComUtil.closeParentLayer(function() {
						});
					}
				});
			})
		</script>
		
	</body>	
</html>